package chars;

import java.io.FileWriter;
import java.io.PrintWriter;

/**
 * @Description
 * @Author zhaobaolin
 * @Date 2018/11/11
 */
public class PrintWriterExample {
    public static void main(String[] args) {
        demo();
    }
    private static void demo()
    {
        String source = "123456";
        try(FileWriter f = new FileWriter("./io/src/chars/print.txt")){
            PrintWriter printWriter = new PrintWriter(f);
            printWriter.print(source);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
